package com.tong.cloud.feign.processor;

import com.tong.cloud.feign.annotation.CustomClient;
import feign.MethodMetadata;
import feign.auth.BasicAuthRequestInterceptor;
import lombok.extern.slf4j.Slf4j;

import java.lang.annotation.Annotation;

@Slf4j
public class CustomClientClassProcessor implements AnnotatedClassProcessor {
    @Override
    public Class<? extends Annotation> getAnnotationType() {
        return CustomClient.class;
    }

    @Override
    public void process(MethodMetadata data, Class<?> clz) {
        log.info("start custom client process...");
        CustomClient customClient = clz.getAnnotation(CustomClient.class);
        log.info("custom client token :@{}", customClient.token());
        data.template().methodMetadata();
    }
}
